<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;

class CommentUpdateRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize(): bool
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules(): array
    {
        return [
            "comm_id" => ["required", Rule::exists("tb_comment", "comm_id")],
            "comm_content" => ["nullable"],
            "comm_is_show" => ["nullable", "integer", "min:0", "max:1"],
        ];
    }
}
